org.eclipse.vtp.desktop.projects.core.internals
Class MediaResource

java.lang.Object
  extended by org.eclipse.vtp.desktop.projects.core.internals.VoiceResource
      extended by org.eclipse.vtp.desktop.projects.core.internals.MediaResource
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, IMediaResource, ObjectListener, IVoiceToolsResource
Direct Known Subclasses:
MediaFile, MediaFolder

public abstract class MediaResource
extends VoiceResource
implements IMediaResource

This is a concrete implementation of IMediaResource and provides the default behavior of that interface.

Version:
2.0
Author:
Trip Gilman

Constructor Summary
MediaResource(IMediaContainer container, org.eclipse.core.resources.IResource resource)
          Craetes a new MediaResource in the provided media container with the given eclipse file resource.
 
Method Summary
 void delete()
          Removes this resource from the project structure.
 boolean exists()
          Determines if this media resource exists.
 java.lang.String getMediaPath()
           
 java.lang.String getName()
           
protected  java.lang.String getObjectId()
          The object id is used by the event system to uniquely identify a project resource.
 IVoiceToolsResource getParent()
          Returns the parent of this resource.
 IMediaContainer getParentMediaContainer()
           
 
Methods inherited from class org.eclipse.vtp.desktop.projects.core.internals.VoiceResource
addRefreshListener, deferEvents, finalize, getAdapter, getProject, processObjectEvent, refresh, removeRefreshListener, resumeEvents
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.vtp.desktop.projects.core.IVoiceToolsResource
addRefreshListener, deferEvents, getProject, refresh, removeRefreshListener, resumeEvents
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Constructor Detail

MediaResource

public MediaResource(IMediaContainer container,
                     org.eclipse.core.resources.IResource resource)
Craetes a new MediaResource in the provided media container with the given eclipse file resource.

Parameters:
container - The parent media container
resource - The eclipse file resource this media resource represnets
Method Detail

exists

public boolean exists()
Description copied from interface: IMediaResource
Determines if this media resource exists.

Specified by:
exists in interface IMediaResource
Returns:
true if the resource exists, false otherwise

getParentMediaContainer

public IMediaContainer getParentMediaContainer()
Specified by:
getParentMediaContainer in interface IMediaResource
Returns:
The parent media container of this media resource

getParent

public IVoiceToolsResource getParent()
Description copied from interface: IVoiceToolsResource
Returns the parent of this resource. If this is a project resource this function returns this.

Specified by:
getParent in interface IVoiceToolsResource
Returns:
The parent of this resource resource

getName

public java.lang.String getName()
Specified by:
getName in interface IVoiceToolsResource
Returns:
The name of the resource

getObjectId

protected java.lang.String getObjectId()
Description copied from class: VoiceResource
The object id is used by the event system to uniquely identify a project resource. In this fashion, multiple references to the resource can be created and still be notified of events.

Specified by:
getObjectId in class VoiceResource
Returns:
A unique identifier for this resource

delete

public void delete()
            throws org.eclipse.core.runtime.CoreException
Description copied from interface: IMediaResource
Removes this resource from the project structure. If this resource is a folder, all items under the resource will also be removed as part of this action.

Specified by:
delete in interface IMediaResource
Throws:
org.eclipse.core.runtime.CoreException - If an error occured during the deletion

getMediaPath

public java.lang.String getMediaPath()
Specified by:
getMediaPath in interface IMediaResource
Returns:
A string representation of this media resource relative to the top level media files folder of this brand or persona project